<?php

/**
 *
 * @version $Id:$
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License, version 2
 */
class Tx_Joinformattac_Controller_JoinFormController extends Tx_Extbase_MVC_Controller_ActionController{
	/**
	 * @var Tx_Joinformattac_Domain_Repository_JoinFormRepository
	 * @var Tx_Joinformattac_Domain_Model_JoinForm
	 */
	
	protected $joinFormRepository;
	protected $test;
	/**
	 * Initializes the current action
	 *
	 * @return void
	 */
	public function initializeAction() {
		$this->joinFormRepository = t3lib_div::makeInstance("Tx_Joinformattac_Domain_Repository_JoinFormRepository");
	}
	/**
	 * Index action for this controller. 
	 * @param Tx_Joinformattac_Domain_Model_JoinForm $newJoinForm A fresh JoinForm object taken as a basis for the rendering
	 * @return string An HTML form for creating a new JoinForm
	 * @dontvalidate $newJoinForm
	 */
	public function indexAction(Tx_Joinformattac_Domain_Model_JoinForm $newJoinForm = NULL) {	
		$this->view->assign('newJoinForm', $newJoinForm);
		/********************************
		$this->test = t3lib_div::makeInstance("Tx_Joinformattac_Domain_Model_JoinForm");
		$this->test->setVorname("Franz");
		$this->test->setNachname("Wurst");
		$this->test->setStrasse("ajcvstr. 12");
		$this->test->setPlz("12345");
		$this->test->setOrt("orrtt");
		$this->test->setLand("Landia");
		$this->test->setBeitrag("3");
		$this->test->setZahlungsrhythmus("vierteljährlich");
		$this->test->setAnrede("Frau");
		$this->test->setBeruf("Klmepner");	
		$this->test->setGeburtstag("1111-11-11");
		$this->test->setTelefon("12339128791");
		$this->test->setFax("127618276");
		$this->test->setEmail("blka@bbla.bla");
		$this->test->setDatenweitergabe(true);
		$this->test->setBemerkungen("Das ist eine Bemerkung!");
		$this->test->setEinzug(true);
		$this->test->setKontonummer("123297998");
		$this->test->setBlz("50050201");
		$this->test->setKontovorname("Hans");
		$this->test->setKontonachname("Wurst");
		t3lib_div::debug($this->test);
		$this->joinFormRepository->add($this->test); 
		/**********************************/
	}
	/**
	 * Creates a new member
	 *
	 * @param Tx_Joinformattac_Domain_Model_JoinForm $newJoinForm A fresh JoinForm object which has not yet been added to the repository
	 * @return void
	 */
	public function becomeAction(Tx_Joinformattac_Domain_Model_JoinForm $newJoinForm) {
		t3lib_div::debug($newJoinForm);
		$this->joinFormRepository->add($newJoinForm);
		$this->flashMessages->add('Liebe_r '.$newJoinForm->getVorname().', willkommen bei attac!');
	}
}
?>